package com.lxj.student_security.mapper;

import com.lxj.student_security.entity.Group;
import com.lxj.student_security.entity.RemoveRecord;
import com.lxj.student_security.entity.User;
import com.lxj.student_security.entity.vo.UserGroupRelation;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

public interface GroupMapper {
    List<Group> findAll(Group group);

    int delete(Integer[] id);

    int add(Group group);

    Group findById(Integer id);

    int edit(Group group);

    List<User> findStudent(Integer id);

    List<UserGroupRelation> findByGroupId(Integer id);

    int addMember(@Param("ids") Integer[] ids,@Param("id") Integer id);

    int deleteMember(@Param("ids") Integer[] ids,@Param("id") Integer id);

    /**
     * 更改用户表的小组标识
     * @param ids
     * @param id
     */
    void updateGroupTip(@Param("ids")Integer[] ids, @Param("id")Integer id);

    void deleteGroupTip(@Param("ids")Integer[] ids, @Param("id")Integer id);

    void deleteGroupFromUser(@Param("id") Integer[] id);

    void deleteGroupFromUserGroup(@Param("id") Integer[] id);

    List<User> selectMember(Integer id);

    List<RemoveRecord> findAllRemoveRecord(RemoveRecord removeRecord);

    int deleteRecord(Integer[] id);

    List<User> findByUsername(@Param("username") String username);

    Group findGroupName(@Param("id") Integer groupTip);
}
